package common.platformclient;

import com.alibaba.fastjson.JSONObject;
import feign.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

@FeignClient(value = "feign-provider",fallbackFactory = PlatformClientFallBack.class)
public interface PlatformClient {

    @GetMapping("/test01")
    JSONObject test01();

    @PostMapping(value = "/fileUpload",produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},consumes = {MediaType.MULTIPART_FORM_DATA_VALUE})
    JSONObject fileUpload(@RequestPart(value = "file") MultipartFile file);

    @GetMapping("/fileDownload")
    Response fileDownload();
}
